﻿// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'

Shader "Custom/TestShader" {
	Properties {
		_Color ("Color", Color) = (1,1,1,1)
	}
	SubShader {
		Tags { "RenderType"="Opaque" }
		LOD 200
		
		pass
		{
			CGPROGRAM
			#pragma vertex vert 
			#pragma fragment frag 
			#include "unitycg.cginc"

			struct v2f
			{
				float4 pos:POSITION;
				float3 normal:TEXCOORD0;
			};


			v2f vert(appdata_base v)
			{
				v2f o;
				o.pos = UnityObjectToClipPos( v.vertex);
				o.normal = v.normal;
				return o;
			}
			float4 _Color;
			float4 frag(v2f v):COLOR
			{
				float4 color = float4(pow(v.normal + float3(0.5,0.5,0.5),1),2);
				color *= _Color;
				return color;
			}
			ENDCG
		}
	}
	FallBack "Diffuse"
}
